In JPEG as an international standard encoding scheme of still image data, encoding/decoding processes gof color image data of 8 bits per component and color image data of 12 bits per component are specified as a lossy encoding scheme using discrete cosine transformation (DCT). Encoding of an 8-bit image is classified as a Baseline process, and that of a 12-bit image, including 8-bit image, is classified as an Extended DCT-based process. This is specified in a reference “ITU-T recommendation T.81 (ISO/IEC 10918-1)”.
Table B.2 in Section B.2.2. of Annex B of this reference specifies the sizes and values of frame header parameters. Also, the numbers of bits to be encoded/decoded are specified as the second parameter P. Baseline sequential DCT, i.e. the Baseline process is limited to an 8-bit image, and the Extended DCT-based process including Extended sequential DCT and progressive DCT can encode/decode 8- and 12-bit images. The number of encoded bits in image data is described in the frame header parameter, and a decoding process is done based on the parameter upon decoding. Hence, the number of encoded bits is equal to the number of bits of image data after decoding for both of 8- and 12-bit images.
A color image input device used so far generates data with a precision of 8 bits or less per component in terms of technical problems and cost, and JPEG compression normally indicates baseline JPEG that compresses 8-bit data.
In recent years, along with the improvement of the precision of an image input device, a digital camera, scanner, and the like can easily generate image data with a precision exceeding 8 bits. Hence, the necessity of Extended sequential DCT-based JPEG that can compress 12-bit data is increasing accordingly.
A major difference between Extended sequential DCT-based JPEG and baseline JPEG is that the number of bits of input data is increased by 4 bits, and is extended so that a color converter, DCT transformer, and quantizer can process 16-fold values.
In an encoding/decoding apparatus that executes a JPEG encoding/decoding process using a dedicated circuit, it is indispensable to introduce an Extended sequential DCT-based JPEG encoder/decoder that can compress/decompress 12-bit data.
When conventional baseline JPEG encoded data is to be decoded using the introduced Extended sequential DCT-based JPEG encoder/decoder, it is a common practice to extract quantization table information included in a header of JPEG encoded data, to execute an inverse quantization process on the basis of the quantization table, and then to execute an inverse DCT process and color conversion process.
FIG. 10 shows the block arrangement of a general decoding apparatus, and its decoding process will be described below.
Referring to FIG. 10, reference numeral 1101 denotes externally input baseline JPEG encoded data; 1103, a header interpreter; 1105, a quantization table storage unit; 1107, a Huffman decoder; 1109, an inverse quantizer; 1111, an inverse DCT unit; 1113, a color converter; and 1115, decoded color image data of 8 bits per component.
The header interpreter 1103 interprets header information of the baseline JPEG encoded data 1101 to extract quantization table information in the header, and stores a quantization step value in the quantization table information in the quantization table storage unit 1105 intact.
On the other hand, Huffman-encoded codes in the baseline JPEG encoded data 1101 are decoded by the Huffman decoder 1107, and quantization values of decoded DCT coefficients are sent to the inverse quantizer 1109.
The inverse quantizer 1109 multiplies the DCT coefficient quantization values by the quantization step value read out from the quantization table storage unit 1105 to restore the quantization values to DCT coefficients, and sends the DCT coefficients to the inverse DCT unit 1111.
The inverse DCT unit 1111 restores the DCT coefficients to real space data, and transfers the data to the color converter 1113. The color converter 1113 performs conversion from YCbCr as luminance and color difference signals into RGB as three primary colors. This color conversion normally uses following formulas (1) that comply with ITU-R BT.601:R=Y+((Cr−k)×1.4020)G=Y−((Cb−k)×0.3441)−((Cr−k)×0.7139)B=Y+((Cb−k)×1.7718)  (1)
Note that a value k=128 is used in 8-bit data conversion. With the above color conversion, RGB data of 8 bits per color is reclaimed.
Paying attention to an apparatus having an Extended sequential DCT-based JPEG decoding function, when baseline JPEG encoded data is to be decoded, the upper 4 bits in 12 bits are set to be zero, and real data is set in the lower 8 bits upon arithmetic operations. Hence, the processing contents are the same as those in a decoder that supports baseline JPEG, and no problem is basically posed.
However, since the apparatus itself has processing performance of 12-bit data, the following problem is posed in terms of the improvement of arithmetic precision by means of effective use of a decoding processor which is extended in an upper bit direction.
When an encoding/decoding process of 8-bit data is executed using an Extended sequential DCT-based JPEG encoder/decoder which can compress/decompress 12-bit data, the same processing method as in the conventional baseline JPEG cannot effectively use 12-bit arithmetic hardware, and image quality cannot be improved due to the improvement of arithmetic precision. Also, deterioration of image quality due to repetition of decompression and re-compression cannot be suppressed.
On the other hand, a demand for higher image quality is increasing currently, and vendors are beginning to develop devices which can process multi-bit data over 8 bits so as to attain higher image quality of the devices. For example, some products of digital cameras and scanners can easily generate image data with a precision over 8 bits per color component.
When an image input device inputs each color component with a multi-bit precision exceeding 8 bits, and an image output device outputs an image with an 8-bit precision, a bit rounding process is required. When the image output device receives only data with an 8-bit precision, the image input device must convert input data into 8-bit data and output the converted data. In this case, the image input device temporarily converts input multi-bit data into 8-bit data, applies an image compression process to the 8-bit data, and outputs the compressed data to the output device. However, the multi-bit input function of the image input device is not effectively used; it becomes useless in practice.